import JSEncrypt from "jsencrypt/bin/jsencrypt";

export function getRsaCode(str: string):string {
	let key:string = "-----BEGIN PUBLIC KEY-----" +
		"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCeYTs9X7FBzBt1jp8xBsltgp/7" +
		"45Fn9DoEZGJ3BfxEZkd8eDUK9gnfhSqCQ0DLs0pGzZB7g6aCOJpwGIlE/JaUpfBZ" +
		"Gqiu1sK37c/pLdRmbav/QfIFEOiggu3x+OQ9seiHkRTwxY5ft0C9gxMNK5fd+1RH" +
		"uVUo4egvImdCy22LvQIDAQAB" +
		"-----END PUBLIC KEY-----";
	let encryptor = new JSEncrypt();
	encryptor.setPublicKey(key);
	let sourse = encryptor.encrypt(str);
	return sourse

}

